package com.github.wxiaoqi.security.crm.core.rest;

import java.util.Map;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.github.wxiaoqi.security.common.crm.request.MerchantBaseRequest;
import com.github.wxiaoqi.security.common.crm.request.QueryMerchantBaseListRequest;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.crm.core.biz.MerchantBaseBiz;
import com.github.wxiaoqi.security.crm.core.entity.MerchantBase;

import io.swagger.annotations.ApiParam;

/**
 * 商户客户基础信息
 * @author centerroot
 * @time 创建时间:2018年7月16日下午6:09:38
 * @description
 */
@RestController
@RequestMapping("merchantBase")
public class MerchantBaseController extends BaseController<MerchantBaseBiz,MerchantBase> {
	
	private MerchantBaseBiz merchantBaseBiz;

	/**
	 * 查询单个商户基础信息详情
	 * @author centerroot
	 * @time 创建时间:2018年7月16日下午6:02:10
	 * @param personalId
	 * @return
	 */
	@RequestMapping(value = "/queryOneByKeys", method = RequestMethod.POST)
    @ResponseBody
	public Map<String, Object> queryOneByKeys(@ApiParam("商户客户编号") @RequestParam(value = "merchantId", required = true) String merchantId){
		return merchantBaseBiz.queryOneByKeys(merchantId);
	}
	
	/**
	 * 添加商户基础信息
	 * @author centerroot
	 * @time 创建时间:2018年7月16日下午6:02:15
	 * @param MerchantBaseRequest
	 * @return
	 */
	@RequestMapping(value = "/add", method = RequestMethod.POST)
    @ResponseBody
	public Map<String, Object> add(MerchantBaseRequest MerchantBaseRequest){
		return merchantBaseBiz.add(MerchantBaseRequest);
	}
	
	/**
	 * 修改商户基础信息
	 * @author centerroot
	 * @time 创建时间:2018年7月16日下午6:02:22
	 * @param MerchantBaseRequest
	 * @return
	 */
	@RequestMapping(value = "/update", method = RequestMethod.POST)
    @ResponseBody
	public Map<String, Object> update(MerchantBaseRequest MerchantBaseRequest){
		return merchantBaseBiz.update(MerchantBaseRequest);
	}
	
	/**
	 * 删除商户基础信息
	 * @author centerroot
	 * @time 创建时间:2018年7月16日下午6:02:30
	 * @param personalId
	 * @return
	 */
	@RequestMapping(value = "/delete", method = RequestMethod.POST)
    @ResponseBody
	public Map<String, Object> delete(@ApiParam("商户客户编号") @RequestParam(value = "merchantId", required = true) String merchantId){
		return merchantBaseBiz.delete(merchantId);
	}
}